﻿using Newtonsoft.Json;
using RabbitBus;
using RabbitMQClient.Consumer;
using RabbitMQClient.Receive;
using System;

namespace RabbitMQClient
{
    class Program
    {
        static void Main(string[] args)
        {
            IBus bus = new RabbitMQBus(true);

            //var delayed = new DelayedReceive() { Msg = $"Delayed消息,发送时间{DateTime.Now}" };
            //bus.Publish(delayed, 50000);


            bus.Publish(new TestReceiveB
            {
                Msg = "test消息"
            });

            //var testB = new TestReceiveB() { Msg = "test消息" };
            //bus.Publish(testB);
            //string _content = JsonConvert.SerializeObject(testB);
            //RabbitMQBus.ConsumerTo<TestReceiveB, TestBConsumer>(_content);


            //bus.Publish(new TestReceiveA
            //{
            //    Msg = "testA消息异常"
            //});
            Console.WriteLine("Hello World!");

        }
    }
}
